import request from '@/utils/request'

export const getArea = () => {
  return request({
    url: '/region/region/list',
    method: 'get'
  })
}

export const getAreaTree = () => {
  return request({
    url: '/region/region/tree?id=0',
    method: 'get'
  })
}

export const getImgs = (ids) => {
  return request({
    url: '/common/file/get/'+ids,
    method: 'get'
  })
}

export const getUploadFiles = (ids) => {
  return request({
    url: '/common/file/get/'+ids,
    method: 'get'
  })
}
export const getUploadFileUrls = (files) => {
  for(let i=0;i<files.length;i++){
    files[i] = {
      ...files[i],
      url:process.env.VUE_APP_BASE_API+files[i].path
    }
  }
  return files
}
